package com.crane.oss.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * 学制-1
 *
 * @author tyh
 *
 */
public enum SchoolSystemEnum {
    /**
     *
     */
    PRIMARY_SYSTEM("1", "小学"),

    JUNIOR_HIGH_SYSTEM("2", "初中"),

    NINE_YEARS_SYSTEM("3","九年一贯制"),

    HIGH_SYSTEM("4", "高中"),

    COMPLETE_SECONDARY_SYSTEM("5","完全中学"),

    TWELVE_YEAR_SYSTEM("6","十二年一贯制");

    private String type;

    private String remark;

    private SchoolSystemEnum(String type, String remark) {
        this.type = type;
        this.remark = remark;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    public static String getRemark(String type){
        for(SchoolSystemEnum systemEnum : SchoolSystemEnum.values()){
              if(systemEnum.getType().equals(type)){
                  return  systemEnum.getRemark();
              }
        }
        return "";
    }
    public static SchoolSystemEnum getSchoolSystemEnum(String type){
        for(SchoolSystemEnum systemEnum : SchoolSystemEnum.values()){
            if(systemEnum.getType().equals(type)){
                return  systemEnum;
            }
        }
        return null;
    }



    public static List<SectionEnum> getSectionEnum(SchoolSystemEnum schoolSystemEnum){
        List<SectionEnum> result=new ArrayList<>();
        switch (schoolSystemEnum){
            case PRIMARY_SYSTEM:
                result.add(SectionEnum.PRIMARY_SCHOOL);
                break;
            case JUNIOR_HIGH_SYSTEM:
                result.add(SectionEnum.JUNIOR_HIGH_SCHOOL);
                break;
            case NINE_YEARS_SYSTEM:
                result.add(SectionEnum.PRIMARY_SCHOOL);
                result.add(SectionEnum.JUNIOR_HIGH_SCHOOL);
                break;
            case HIGH_SYSTEM:
                result.add(SectionEnum.HIGH_SCHOOL);
                break;
            case COMPLETE_SECONDARY_SYSTEM:
                result.add(SectionEnum.JUNIOR_HIGH_SCHOOL);
                result.add(SectionEnum.HIGH_SCHOOL);
                break;
            case TWELVE_YEAR_SYSTEM:
                result.add(SectionEnum.PRIMARY_SCHOOL);
                result.add(SectionEnum.JUNIOR_HIGH_SCHOOL);
                result.add(SectionEnum.HIGH_SCHOOL);
                break;
            default:
        }
        return result;
    }

}
